<script src="/public/system/js/contabs.js"></script>
{volist name="ruleList" id="one"}
{eq name="one.is_son" value="1"}
<li {eq name="i" value="1"}class="active"{/eq}>
    <a href="{$one.url}" title="{$one.title}">{notempty name="one.icon"}<i class="fa {$one.icon}"></i>{/notempty} <span class="nav-label">{$one.title}</span>
        <span class="fa arrow"></span></a>
    <ul class="nav nav-second-level">
        {volist name="one.children" id="two"}
        {eq name="two.is_son" value="1"}
        <li>
            <a href="{$two.url}">{notempty name="two.icon"}<i class="fa {$two.icon}"></i>{/notempty} {$two.title} <span class="fa arrow"></span></a>
            <ul class="nav nav-third-level">
                {volist name="two.children" id="three"}
                <li><a class="J_menuItem" href="{$three.url}">{notempty name="three.icon"}<i class="fa {$three.icon}"></i>{/notempty} {$three.title}</a></li>
                {/volist}
            </ul>
        </li>
        {else/}
        <li><a class="J_menuItem" href="{$two.url}" title="{$two.title}">{notempty name="two.icon"}<i class="fa {$two.icon}"></i>{/notempty} {$two.title}</a></li>
        {/eq}
        {/volist}
    </ul>
</li>
{else/}
{switch name="one.condition"}
{case value="custom-content"}
<li class="active">
    <a href="{$one.url}" title="{$one.title}">{notempty name="one.icon"}<i class="fa {$one.icon}"></i>{/notempty} <span class="nav-label">{$one.title}</span>
        <span class="fa arrow"></span></a>
    <span class="J_menuItem hidden" id="cmsMenu" data-index="cms" href="{:url('Public/iframe')}">文档管理</span>
    <ul id="tree" class="ztree" style="background:#fff;margin:0 4px;"></ul>
</li>
<script type="text/javascript" charset="utf-8">
    $(function(){
        get_category_tree();
    });
    //显示左侧栏目列表TREE
    function get_category_tree() {
        $.post("{:url('Cms/ajaxztree')}", function (res) {
            var setting = {
                data: {
                    simpleData: {enable: true}
                },
                callback: {
                    onClick: onClick
                }
            };
            var zNodes = res;
            $(document).ready(function () {
                $.fn.zTree.init($("#tree"), setting, zNodes);
            });
        }, 'json');
    }
    //单击展开关闭
    function onClick(e,treeId, treeNode) {
        var zTree = $.fn.zTree.getZTreeObj("tree");
        var url = treeNode.url;
        if(url=='javascript:;'){
            zTree.expandNode(treeNode);
        }else{
            $('#cmsMenu').trigger('click');
        }
    }
</script>
{/case}
<!--
{case value="custom-goods"}
<li class="active">
    <a href="{$one.url}" title="{$one.title}">{notempty name="one.icon"}<i class="fa {$one.icon}"></i>{/notempty} <span class="nav-label">{$one.title}</span>
        <span class="fa arrow"></span></a>
    <span class="J_menuItem hidden" id="goodsMenu" data-index="goods" href="{:url('ShopGoods/iframe')}">商品管理</span>
    <ul id="goodsTree" class="ztree" style="background:#fff;margin:0 4px;"></ul>
</li>
<script type="text/javascript" charset="utf-8">
    $(function(){
        get_goods_category_tree();
    });
    //显示左侧栏目列表TREE
    function get_goods_category_tree() {
        $.post("{:url('ShopGoods/ajaxztree')}", function (res) {
            var setting = {
                data: {
                    simpleData: {enable: true}
                },
                callback: {
                    onClick: onClick
                }
            };
            var zNodes = res;
            $(document).ready(function () {
                $.fn.zTree.init($("#goodsTree"), setting, zNodes);
            });
        }, 'json');
    }
    //单击展开关闭
    function onClick(e,treeId, treeNode) {
        var zTree = $.fn.zTree.getZTreeObj("goodsTree");
        var url = treeNode.url;
        if(url=='javascript:;'){
            zTree.expandNode(treeNode);
        }else{
            $('#goodsMenu').trigger('click');
        }
    }
</script>
{/case}
-->
{default /}
<li>
    <a class="J_menuItem" href="{$one.url}"  title="{$one.title}">
        {notempty name="one.icon"}<i class="fa {$one.icon}"></i>{/notempty} <span class="nav-label">{$one.title}</span>
    </a>
</li>
{/switch}
{/eq}
{/volist}